<?php
header('Content-Type:text/html; Charset=UTF-8');
include 'lib/checker.php';

@$pid = $_REQUEST['pid'];

$title = '删除联系人错误提示';
$jumpUrl = 'listperson.php';

if(empty($pid)){
	$message = '获取联系人信息出错';
	include 'lib/message.php';
	die;
}

require 'lib/db.php';

$flag = dbDelete('delete from person where id=:id',array('id'=>$pid));

$jumpUrl = 'editperson.php?pid='.$pid;

if(!$flag){
	$message = '删除联系人失败，请先删除联系人相关号码';
	include 'lib/message.php';
	die;
}

header('location:listperson.php');